package com.shengsheng.expschedule.service.base.exception;

import com.shengsheng.expschedule.base.result.ResultCodeEnum;
import lombok.Data;

/**
 * @author yuan
 * @date 2021/09/27
 */
@Data
public class ExpScheduleException extends RuntimeException {

    private Integer code;

    public ExpScheduleException(String message, Integer code) {
        super(message);
        this.code = code;
    }

    public ExpScheduleException(ResultCodeEnum resultCodeEnum) {
        super((resultCodeEnum.getMessage()));
        this.code = resultCodeEnum.getCode();
    }

    @Override
    public String toString() {
        return "ExpScheduleException{" +
                "code=" + code +
                ",message=" + this.getMessage() +
                '}';
    }
}
